package com.wsd.jing.controller.system;

import com.wsd.jing.annotation.ControllerLog;
import com.wsd.jing.request.CommonResponse;
import com.wsd.jing.service.IMonitorService;
import com.wsd.jing.vo.MonitorVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * All rights Reserved, Designed By www.tom.com
 *
 * @author tom
 * @version 1.0.0
 * @projectName: jing
 * @packageName: com.wsd.jing.controller
 * @className: MonitorController
 * @description 监控管理前端控制器
 * @createDate 2022/12/7 15:06
 * @copyright 2022/12/7 15:06 www.tom.com Inc. All rights reserved.
 */
@Api(tags = "系统监控")
@Validated
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/rest/monitor")
public class MonitorController {
    private final IMonitorService monitorService;

    @ApiOperation(value = "查询")
    @GetMapping("server")
    @ControllerLog(action = "查询系统监控", message = "查询系统监控失败")
    // @SaCheckPermission("monitor:server")
    public CommonResponse getServerInfo() {
        MonitorVO monitorDTO = monitorService.getServerInfo();
        return CommonResponse.success(monitorDTO, "查询成功");
    }
}
